package com.yearns.kafka.util;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

/**
 * 消费者 spring-kafka 2.0 + 依赖JDK8
 * @author yearns
 */
@Component
public class KafkaConsumer {
    /**
     * 监听yearns主题,有消息就读取
     * @param message
     */
    @KafkaListener(topics = {"yearns"})
    public void receiveMessage(String message){
    	System.out.println("接收到的消息"+message);
    }
}